<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<% String path = request.getContextPath(); %>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=path %>/css/public.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="<%=path %>/js/jquery-easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="<%=path %>/js/jquery-easyui/themes/icon.css">
<script type="text/javascript" src="<%=path %>/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path %>/js/jquery-easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/global.js"></script>

<title>Insert title here</title>
</head>
<body>
	<table id="list" class="easyui-datagrid" toolbar="#tb" data-options="
		url:'<%=path %>/product/queryByPager', 
		method:'get', 
		rownumbers:true,
		singleSelect:true,
		autoRowHeight: true,
		pagination:true,
		border:false,
		pageSize:20">
		<thead>
			<tr>
				<th field="id" checkbox="true" width="100">产品编号</th>
				<th field="name" width="200">学期</th>
				<th field="price"  width="200">课程</th>
			</tr>
		</thead>
	</table>
	<div id="tb" style="padding:10px;">
		<a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="add();">添加</a>
		<!-- 链接按钮控件 -->
		<a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="edit();">修改</a>
		<a href="javascript:;" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="removePro();">移除</a>
	</div>
	
	<div id="addWin" class="easyui-window" title="添加产品" data-options="iconCls:'icon-edit', closable:true, closed:true"  style="width:300px;height:200px;padding:5px;">
		<form id="addForm" enctype="multipart/form-data">
			<table>
				<tr>
					<td>编号</td>
					<td>
						<input class="textbox" name="id" readonly />
					</td>
				</tr>
				<tr>
					<td>名称</td>
					<td>
						<input class="easyui-validatebox textbox" name="name" data-options="required:true, novalidate:true" /><!-- 由dataoptions指定验证的规则 -->
					</td>
				</tr>
				<tr>
					<td>价格</td>
					<td>
						<input class="easyui-validatebox easyui-numberbox" name="price" data-options="required:true,precision:2"/>
					</td>
				</tr>
				<tr>
					<td></td>
					<td>
						<input type="button" onclick="doAdd();" value="确认" />
					</td>
				</tr>
			</table>
		</form>
	</div>
	
	<div id="editWin" class="easyui-window" title="修改产品" data-options="iconCls:'icon-edit', closable:true, closed:true"  style="width:300px;height:200px;padding:5px;">
		<form id="editForm" enctype="multipart/form-data">
			<table>
				<tr>
					<td>编号</td>
					<td>
						<input class="textbox" name="id" readonly />
					</td>
				</tr>
				<tr>
					<td>名称</td>
					<td>
						<input class="easyui-validatebox textbox" name="name" data-options="required:true" /><!-- 由dataoptions指定验证的规则 -->
					</td>
				</tr>
				<tr>
					<td>价格</td>
					<td>
						<input class="easyui-validatebox easyui-numberbox" name="price" data-options="required:true,precision:2"/>
					</td>
				</tr>
				<tr>
					<td>生产日期</td>
					<td><input class="easyui-datetimebox" value="10/11/2012 2:3:56" style="width:200px"></td>
				</tr>
				<tr>
					<td>产品类别</td>
					<td>
						<select class="easyui-combobox" name="state" style="width:200px;">
							<option value="AL">Alabama</option>
							<option value="AK">Alaska</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>上传图片</td>
					<td><input class="easyui-filebox" name="img" data-options="prompt:'请选择一个图片'"></td>
				</tr>
				<tr>
					<td></td>
					<td>
						<input type="button" onclick="doEdit();" value="确认" />
					</td>
				</tr>
			</table>
		</form>
	</div>
	
	<div id="mm" class="easyui-menu" style="width:120px;">
		<div id="new" data-options="name:'new'">New</div>
		<div data-options="name:'save',iconCls:'icon-save'">Save</div>
		<div data-options="name:'print',iconCls:'icon-print'">Print</div>
		<div class="menu-sep"></div>
		<div data-options="name:'exit'">Exit</div>
	</div>
</body>
</html>